<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

    use think\Route;
//    Route::rule('路由表达式','路由地址','请求类型','路由参数(数组)','变量规则(数组)');
    //get, post, put, delete, *    请求方式 不清楚的参考文档

Route::get('api/:version/banner/:id','api/:version.Banner/getBanner');
Route::post('api/:version/post','api/:version.Banner/get');

Route::get('api/:version/theme/:id','api/:version.theme/getComplexOne');
Route::get('api/:version/theme','api/:version.theme/getSimpleList');


/*路由变量规则与分组*/
//Route::get('api/:version/product/by_category','api/:version.product/getAllInCategory');
//Route::get('api/:version/product/:id','api/:version.product/getOne',[],['id'=>'\d+']);
//Route::get('api/:version/product/recent','api/:version.product/getRecent');

Route::group('api/:version/product',function (){
    Route::get('/by_category','api/:version.product/getAllInCategory');
    Route::get('/:id','api/:version.product/getOne',[],['id'=>'\d+']);
    Route::get('/recent','api/:version.product/getRecent');
});

Route::get('api/:version/category/all','api/:version.Category/getAllCategories');

Route::post('api/:version/token/user','api/:version.Token/getToken');

Route::post('api/:version/address','api/:version.Address/createOrUpdateAddress');

//Route::get('api/:version/second','api/:version.Address/second');

Route::post('api/:version/order','api/:version.Order/placeOrder');
Route::post('api/:version/by_user','api/:version.Order/getSummaryByUser');

Route::post('api/:version/pay/pay_order','api/:version.Pay/getPreOrder');
//微信回调通知
Route::post('api/:version/pay/notyify','api/:version.Pay/receiveNotify');
Route::post('api/:version/pay/re_notyify','api/:version.Pay/redirectNotify');